import { createRouter, createWebHistory } from "vue-router";
const routes = [
    {
        path: '/Login',
        name: 'Login',
        // 异步加载，打包时代码分割，性能优化
        component: () => import('../components/Login.vue')
    },
    {
        path: '/Main',
        name: 'Main',
        // 异步加载，打包时代码分割，性能优化
        component: () => import('../components/Main.vue'),
        children: [
            {
                name: 'Product',
                path: 'Product',
                component: () => import('../components/product.vue')
            }
        ]
    },
    {
        path: '/',
        redirect: "Login",
    },
]

const router = createRouter({
    history: createWebHistory(), // 路由模式：history模式
    routes: routes
})
export default router;